layui.use(['form','jquery'], function() {
    var form = layui.form,
        $ = layui.jquery,
        layer = layui.layer;


    /*
        从后台加载区域列表
    */
    $(document).ready(function () {

        //发送post请求，获取所有租赁区域信息
        $.post('/tenancy-area/getAreaIdAndName', function (info) {
            //遍历循环信息
            info.data.forEach(function (area) {
                $("#tenancyAreaName").append("<option value=" + area.tenancyAreaId + ">" + area.tenancyAreaName + "</option>");
                form.render('select');
            })
        });

        //发送post请求，获取所有销售区域信息
        $.post('/broker-building/getSaleArea', function (info) {
            //遍历循环信息
            info.data.forEach(function (area) {
                $("#saleAreaName").append("<option value=" + area.saleAreaId + ">" + area.saleAreaName + "</option>");
                form.render('select');
            })
        });
    });

});